<?php

namespace Home\Model;

use Think\Model;
use Think\Model\RelationModel;

class OrderProductModel extends RelationModel
{

    protected $_link = array(
//        'User' => self::BELONGS_TO
        'mapping_type'  => self::BELONGS_TO,
    'class_name'    => 'Dept',
    'foreign_key'   => 'userId',
    'mapping_name'  => 'dept',
    // 定义更多的关联属性
    ……
    );
}